<?php
use yii\helpers\Html;
use yii\bootstrap\ActiveForm;

/* @var $this yii\web\View */
/* @var $form yii\bootstrap\ActiveForm */
/* @var $model \common\models\LoginForm */

$this->title = 'Sign In';

$fieldOptions1 = [
    'options' => ['class' => 'form-group has-feedback'],
    'inputTemplate' => "{input}<span class='glyphicon glyphicon-envelope form-control-feedback'></span>"
];

$fieldOptions2 = [
    'options' => ['class' => 'form-group has-feedback'],
    'inputTemplate' => "{input}<span class='glyphicon glyphicon-lock form-control-feedback'></span>"
];
?>

<div class="login-box">
    <div class="login-logo">
        <a href="#"><a href="#"><b><?= Yii::t('app', 'HR Backend Admin System')?></b></a></a>
    </div>
    <!-- /.login-logo -->
    <div class="login-box-body">
        <p class="login-box-msg"><?= Yii::t('app', 'Sign in to start your session')?></p>

        <?php $form = ActiveForm::begin(['id' => 'login-form', 'enableClientValidation' => false]); ?>

        <?= $form
            ->field($model, 'username', $fieldOptions1)
            ->label(false)
            ->textInput(['placeholder' => $model->getAttributeLabel('username')]) ?>

        <?= $form
            ->field($model, 'password', $fieldOptions2)
            ->label(false)
            ->passwordInput(['placeholder' => $model->getAttributeLabel('password')]) ?>

        <div class="row">
            <div class="col-xs-8">
                <?= $form->field($model, 'rememberMe')->checkbox() ?>
            </div>
            <!-- /.col -->
            <div class="col-xs-4">
                <?= Html::submitButton(Yii::t('app', 'Sign in'), ['class' => 'btn btn-primary btn-block btn-flat', 'name' => 'login-button']) ?>
            </div>
            <!-- /.col -->
        </div>


        <?php ActiveForm::end(); ?>

        <div class="social-auth-links text-center">
<!--            <p>- OR -</p>-->
<!--            <a href="/qywx/auth/auth?authclient=qywx" class="btn btn-block btn-social btn-dropbox">-->
<!--                <i class="fa fa-ticket"></i>使用企业通行证登录-->
<!--            </a>-->
            <a href="https://open.work.weixin.qq.com/wwopen/sso/qrConnect?appid=wxd11fdf2cc211b34a&agentid=1000019&redirect_uri=http%3A%2F%2Fwww.gzkr945.com%2Fqywx%2Fauth%2Fauth-finish&state=web_login@gyoss9"
                class="btn btn-block btn-social btn-weixin btn-flat"><i class="fa fa-weixin"></i>
                <?= Yii::t('app', 'Sign in using Weixin')?>
            </a>
        </div>
<!--        放置微信登陆二维码-->
        <div id="wx_reg"></div>
        <!-- /.social-auth-links -->

<!--        <a href="#">I forgot my password</a><br>-->
        <?= Html::a(Yii::t('app', 'Forgot Password'), ['site/request-password-reset']) ?>
        <br>
        <a href="register.html" class="text-center"><?= Yii::t('app', 'Register a new membership')?></a>
    </div>
    <!-- /.login-box-body -->
</div><!-- /.login-box -->

<script src="http://rescdn.qqmail.com/node/ww/wwopenmng/js/sso/wwLogin-1.0.0.js"></script>
<script>
    <?php $this->beginBlock('js_running')?>
    $(function () {
        $('.btn-weixin').click(function () {
//            window.WwLogin({
//                "id" : "wx_reg",
//                "appid" : "wxd11fdf2cc211b34a",
//                "agentid" : "1000019",
//                "redirect_uri" :"www.gzkr945.com",
//                "state" : "abcd",
//                "href" : "",
//            });
        });
    });
    <?php $this->endBlock()?>
</script>
<?php
$this->registerJs($this->blocks['js_running'], \yii\web\View::POS_END)
?>
